<!--
 * @Author: 詹真琦(legendryztachi@gmail.com)
 * @Date: 2022-05-17 11:24:59
 * @LastEditors: 詹真琦(legendryztachi@gmail.com)
 * @LastEditTime: 2022-08-18 10:49:11
 * @FilePath: \code\ctp-static-portal-front\src\views\bulletin\page\index.vue
 * @Description: 
-->
<template>
  <div class="container">
    <Header />
    <div class="content">
      <Title />
      <div class="noData" v-if="!showList.length"> 没任何公告哦 </div>
      <bulletinItem v-for="item in showList" :key="item.id" :data="item" />
    </div>
  </div>
</template>

<script>
  import Header from '../components/header';
  import bulletinItem from '../components/bulletinItem';
  import emitter from '../../../utils/emitter';
  import Title from '../components/title.vue';

  export default {
    name: 'BulletinPage',
    components: { Header, bulletinItem, Title },
    props: {
      bulletinData: {
        type: Array
      }
    },
    data() {
      return {
        // currentSelectedType: 'new'
      };
    },
    computed: {
      showList() {
        // console.log(this.bulletinData);
        return this.bulletinData ? this.bulletinData : [];
      }
    },
    mounted() {
      let that = this;
      emitter.subscribe('changeSelectType', function (current) {
        that.currentSelectedType = current;
      });
    }
  };
</script>

<style lang="scss" scoped>
  .container {
    background: #f1f0ed;

    .content {
      position: absolute;
      top: 60px;
      bottom: 0;
      left: 50%;
      width: 1150px;
      height: auto;
      padding-top: 20px;
      margin: 0 auto;
      margin-left: -575px;
      overflow-x: hidden;
      overflow-y: auto;
      background: #fff;
      border: 1px solid #e6e6e6;
    }
  }
</style>
